<?php

if (!$usr->checkPermission('mod_gallery_tables','u'))
{
    print "<b>Sie haben nicht die entsprechenden Rechte, um die Tabellen einzurichten!</b>";
    exit;
}

if ($env->param('createTables')){
 if ($env->param('gallery')){
   print "Erzeuge Galerie-Konfiguration<br>";
   $udba->query("Drop table if exists ".$tableforwarder."_mod_gallery_conf;");
   $udba->query("create table ".$tableforwarder."_mod_gallery_conf (".
        "id int unsigned not NULL auto_increment,instance varchar(40) not null,".
        "thumb_height int, thumb_width int, height int, width int,".
        " rows int, cols int, primary key(id), index(instance));");
 }
} else {
?>
<?php echo $udba->getError() ?>
<form action="<?=$scriptname?>" method="GET">
                <input type="hidden" name="module" value="<?=$module?>">
                <input type="hidden" name="instance" value="<?=$instance?>">
                <input type="hidden" name="target" value="createTables.php">
                <input type="hidden" name="createTables" value="true">
        <input type="checkbox" value="on" name="gallery">Galerie<br>
        <input type="submit" class="button" value="einrichten">
</form>
<?php
}
?>